<?php

Yii::import('common.models._base.BaseUserProfile');

class UserProfile extends BaseUserProfile {

    public static function model($className = __CLASS__) {
        return parent::model($className);
    }

    public function rules() {
        return array(
            array('first_name, last_name, phone, address_line1,zip_code', 'required'),
            array('user_id', 'numerical', 'integerOnly' => true),
            array('first_name, last_name, phone, photo, address_line1, address_line2, street', 'length', 'max' => 45),
            array('about, update_time', 'safe'),
            array('first_name, last_name, phone, photo, address_line1, address_line2, street, about, update_time', 'default', 'setOnEmpty' => true, 'value' => null),
            array('profile_id, first_name, last_name, phone, photo, address_line1, address_line2, street, about, update_time, user_id', 'safe', 'on' => 'search'),
            array('photo,', 'file', 'allowEmpty' => true,
                'types' => 'jpg, jpeg,gif',
                'maxSize' => 1024 * 1024 * 1, // 1MB
                'tooLarge' => 'The file was larger than 1MB. Please upload a smaller file.'),
        );
    }

}